import Vue from 'vue';
import login from '../views/login/login';
import VueRouter from 'vue-router';
import shouye from '../views/shouye/shouye.vue'
import qunzongyijian from '../views/qunzongyijian/qunzongyijian.vue'
import dangwu from '../views/dangwu/dangwu.vue'
import cunwu from '../views/cunwu/cunwu.vue'
import cunzhuangjieshao from "../views/cunwu/cunzhuangjieshao"
import cunganbu from "../views/cunwu/cunganbu"
import cunmin from "../views/cunwu/cunmin"
import cunhuodong from "../views/cunwu/cunhuodong"
import cunhuiyi from "../views/cunwu/cunhuiyi"
import hukoqianyi from "../views/cunwu/hukoqianyi"
import buzhuxiang from "../views/cunwu/buzhuxiang"
import buzhuhu from "../views/cunwu/buzhuhu"
import buzhuduixiang from "../views/cunwu/buzhuduixiang"
import caiwu from '../views/caiwu/caiwu.vue'
import ziyuan from '../views/caiwu/ziyuan.vue'
import zichan from '../views/caiwu/zichan.vue'
import zijin from '../views/caiwu/zijin.vue'
import xiangmujianshe from '../views/caiwu/xiangmujianshe.vue'
import dangyuanfazhan from '../views/dangwu/dangyuanfazhan'
import dangzuzhihuodong from '../views/dangwu/dangzuzhihuodong'
import my from '../views/my/my'
import test from '../components/test'
import page404 from '../views/page404'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'login',
    component: login
  }, {
    path: '/shouye',
    name: 'shouye',
    component: shouye
  }, {
    // 群众意见
    path: "/qunzongyijian",
    name: "qunzongyijian",
    component: qunzongyijian
  }, {
    // 党务
    path: "/dangwu",
    name: "dangwu",
    component: dangwu,
    redirect: "/dangyuanfazhan",
    children: [{
      path: '/dangyuanfazhan',
      name: 'dangyuanfazhan',
      component: dangyuanfazhan
    }, {
      path: '/dangzuzhihuodong',
      name: 'dangzuzhihuodong',
      component: dangzuzhihuodong
    }, ]
  }, {
    // 村务
    path: "/cunwu",
    name: "cunwu",
    component: cunwu,
    redirect: "/cunzhuangjieshao",
    children: [{
      path: '/cunzhuangjieshao',
      name: 'cunzhuangjieshao',
      component: cunzhuangjieshao
    }, {
      path: '/cunganbu',
      name: 'cunganbu',
      component: cunganbu
    }, {
      path: '/cunmin',
      name: 'cunmin',
      component: cunmin
    }, {
      path: '/cunhuodong',
      name: 'cunhuodong',
      component: cunhuodong
    }, {
      path: '/cunhuiyi',
      name: 'cunhuiyi',
      component: cunhuiyi
    }, {
      path: '/hukoqianyi',
      name: 'hukoqianyi',
      component: hukoqianyi
    }, {
      path: '/buzhuxiang',
      name: 'buzhuxiang',
      component: buzhuxiang
    }, {
      path: '/buzhuhu',
      name: 'buzhuhu',
      component: buzhuhu
    }, {
      path: '/buzhuduixiang',
      name: 'buzhuduixiang',
      component: buzhuduixiang
    }, ]
  }, {
    path: "/caiwu",
    name: "caiwu",
    component: caiwu,
    redirect: "/ziyuan",
    children: [{
      path: '/ziyuan',
      name: 'ziyuan',
      component: ziyuan
    }, {
      path: '/zichan',
      name: 'zichan',
      component: zichan
    }, {
      path: '/zijin',
      name: 'zijin',
      component: zijin
    }, {
      path: '/xiangmujianshe',
      name: 'xiangmujianshe',
      component: xiangmujianshe
    }, ]
  },
  {
    path: "/my",
    name: "my",
    component: my,
  },
  {
    path: "/test",
    name: "test",
    component: test,
  },
  {
    path: '/404',
    name: "page404",
    component: page404,
  },
]

const router = new VueRouter({
  routes
})

export default router
